﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using stwh_Model;
//导入命名空间
using stwh_Web.stwh_admin.Common;
using Senparc.Weixin;
using Senparc.Weixin.MP;
using Senparc.Weixin.MP.TenPayLibV3;
using Senparc.Weixin.MP.AdvancedAPIs;
using stwh_Common.HttpProc;
using stwh_Common;

namespace stwh_Web.shopping
{
    public partial class OAuth : WebPageShopBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //判断是否登录
            stwh_buyuser model = CheckLogin();
            if (model == null)
            {
                Response.Redirect("/shop/login.html?reUrl=/shop/user.html");
            }
            else
            {
                //stwh_wxuser jbwxmodel = Session["wxmodel"] as stwh_wxuser;
                string paytype = Request["paytype"];//支付方式
                //判断支付方式
                switch (paytype)
                {
                    case "1"://微信支付
                        //结算页面
                        string returnUrl = string.Format(WebClient.GetWebSite() + "/shop/pay_wechat.html");
                        string state = string.Format("{0}", this.GetHashCode());
                        //ring url = OAuthApi.GetAuthorizeUrl(jbwxmodel.stwh_wxuappid, returnUrl, state, OAuthScope.snsapi_base);
                        string url = "";
                        Response.Redirect(url);
                        break;
                    case "2"://支付宝
                        break;
                    case "3"://银行卡
                        break;
                    default://到付
                        break;
                }
            }
        }
    }
}